package org.wltea.analyzer.dic;

/**
 * @author cloud
 * @description: 热词更新线程
 * @date 2019/5/3 12:54
 **/
public class HotReLoadDicThread implements Runnable {
    @Override
    public void run() {
        while (true) {
            try {
                if (HotReLoadDicConfig.getInstance().isLoadAble()) {
                    Dictionary.getSingleton().reLoadMainDict();
                    Thread.sleep(HotReLoadDicConfig.getInstance().getReloadInterval());
                }else{
                    Thread.sleep(1000l*60*60*12);
                }
            } catch (InterruptedException e) {
                e.printStackTrace();
            }
        }
    }
}
